function  graphs_perturb_parameters(param_unc,fp)

%Technology (Cobb-Douglas, PS=1);
param_con(1) = exp(param_unc(1)/100);    %Children's skills (alpha1);
param_con(2) = exp(param_unc(2)/100);    %Peers' Skills (alpha2);
param_con(3) = exp(param_unc(3)/100);    %Investments (alpha3);
param_con(4) = param_unc(4)/100;         %Parenting Style (alpha0);

%Technology (CES, PS=0);
param_con(5) = exp(param_unc(5)/100)./(1 + exp(param_unc(5)/100) );         %CES Elasticity (   Parents vs Peers, inner)
param_con(6) = exp(param_unc(6)/100)./(1 + exp(param_unc(6)/100) );         %CES Share Skills ;
param_con(7) = exp(param_unc(7)/100)./(1 + exp(param_unc(7)/100) );         %CES Share Peers;
param_con(8) = -exp(param_unc(8)/100) ;                                     %CES Elasticity ( Skills vs Parents-Peers, outer);
param_con(9) = param_unc(9)/100 ;                                           %Return to Scale CES;

%TFP
param_con(10) = param_unc(10)/100;           %TFP constant;
param_con(11) = param_unc(11)/100;           %TFP trend;

ind  = 11 ;

%Parent's Preferences;
param_con(ind+1) =      exp(param_unc(ind+1)/100);                    %Weight on Children's Skills;
param_con(ind+2) =      param_unc(ind+2)/100 ;                        %Disutility of PS;
param_con(ind+3) =      param_unc(ind+3)/100 ;                        %Heterogeneity in PS;

ind  = ind + 3 ;

%Child's Preferences;
param_con(ind+1) =  param_unc(ind+1)/100;                       %Constant (gamma0);
param_con(ind+2) =  param_unc(ind+2)/100;                       %Own Skills (gamma1);
param_con(ind+3) =  param_unc(ind+3)/100;                       %Child j 's Skills (gamma2);
param_con(ind+4) =  param_unc(ind+4)/100;                       %Homophily (gamm3);
param_con(ind+5) =  param_unc(ind+5)/100;                       %PS effect (gamma4);

param_con(ind+6) =      param_unc(ind+6)/100 ;                        %Disutility of PS (Neighborhood 1);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Panel A: Homophily Parameter;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;

grid_perturb = 0.5:0.1:1.5;
param_con_pertub = param_con;

moment_perturb = NaN(length(grid_perturb),5);
moment_perturb_keep = cell(5,1);
for j = 1:1:length(grid_perturb)
param_con_pertub(18) = param_con(18).*grid_perturb(j);

sim = sim_data_function(param_con_pertub,fp) ;
simul_data = sim.sim_data ; 
sim_data_network = sim.sim_data_network;
sim_moments = mom_function(simul_data,sim_data_network,fp);   
moment_perturb(j,1) = sim_moments(11,1);
moment_perturb_keep{1}(:,j)= sim_moments(:,1);
end

h1=figure;
plot(grid_perturb,moment_perturb(:,1),'--bo','LineWidth',3.5,...
                       'MarkerEdgeColor','b',...
                       'MarkerFaceColor','b',...
                       'MarkerSize',7.5)
hold on
%plot(grid_perturb,repmat(data_moments(11,1),[length(grid_perturb),1]),'-r','LineWidth',1.5)
%legend('Regression Coefficient (Model)', 'Regression Coefficient (Data)', 'Location', 'northwest') 
%legend('Regression Coefficient', 'Location', 'northwest') 
xlabel('Homophily Parameter (\gamma_3, relative to baseline estimates)');
ylabel('Effect Current Skills on Future Peers (Regression Coefficient)');
xticks(grid_perturb)
hold off
cd(fp.paper)    
hgexport(h1, 'Perturbation1.png',hgexport('factorystyle'), 'Format', 'png');
hgexport(h1, 'Perturbation1.eps',hgexport('factorystyle'), 'Format', 'eps'); 
cd(fp.matlab)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Panel B: Parameter of the Impact of PS on Homophily;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;

%reset initial baseline estimates;
param_con_pertub = param_con;

for j = 1:1:length(grid_perturb)
param_con_pertub(19) = param_con(19).*grid_perturb(j);
sim = sim_data_function(param_con_pertub,fp) ;
simul_data = sim.sim_data ; 
sim_data_network = sim.sim_data_network;
sim_moments = mom_function(simul_data,sim_data_network,fp);   
moment_perturb(j,2) = sim_moments(13,1);
moment_perturb_keep{2}(:,j)= sim_moments(:,1);
end

h2=figure;
plot(grid_perturb,moment_perturb(:,2),'--bo','LineWidth',3.5,...
                       'MarkerEdgeColor','b',...
                       'MarkerFaceColor','b',...
                       'MarkerSize',7.5)
hold on
%plot(grid_perturb,repmat(data_moments(13,1),[length(grid_perturb),1]),'-r','LineWidth',1.5)
%legend('Regression Coefficient (Model)', 'Regression Coefficient (Data)', 'Location', 'northwest') 
%legend('Regression Coefficient', 'Location', 'northwest') 
xlabel('Parenting Style Impact on Homophily (\gamma_4, relative to baseline estimates)');
ylabel('Effect Parenting Style on Future Peers (Regression Coeff)');
xticks(grid_perturb)
hold off
cd(fp.paper)    
hgexport(h2, 'Perturbation2.png',hgexport('factorystyle'), 'Format', 'png');
hgexport(h2, 'Perturbation2.eps',hgexport('factorystyle'), 'Format', 'eps'); 
cd(fp.matlab)



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Panel C: Elasticity of Substitution in CES (Peers vs Parents);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;

param_con_pertub = param_con;

for j = 1:1:length(grid_perturb)

param_con_pertub(5) = param_con(5)*grid_perturb(j);
               
sim = sim_data_function(param_con_pertub,fp) ;
simul_data = sim.sim_data ; 
sim_data_network = sim.sim_data_network;
sim_moments = mom_function(simul_data,sim_data_network,fp);    
moment_perturb(j,3) = sim_moments(19,1);
moment_perturb_keep{3}(:,j)= sim_moments(:,1);
end

h3=figure;
plot(grid_perturb,moment_perturb(:,3),'--bo','LineWidth',3.5,...
                       'MarkerEdgeColor','b',...
                       'MarkerFaceColor','b',...
                       'MarkerSize',7.5)
hold on
%plot(grid_perturb,repmat(data_moments(19,1),[length(grid_perturb),1]),'-r','LineWidth',1.5)
%legend('Regression Coefficient (Model)', 'Regression Coefficient (Data)', 'Location', 'northeast') 
%legend('Regression Coefficient', 'Location', 'northwest') 
xlabel('Elast. Substitution Peers vs. Parents (\alpha_{3,0}, relative to baseline estimates)');
ylabel('Effect of Peers on Parental Investments (Regression Coeff)');
xticks(grid_perturb)
hold off
cd(fp.paper)    
hgexport(h3, 'Perturbation3.png',hgexport('factorystyle'), 'Format', 'png');
hgexport(h3, 'Perturbation3.eps',hgexport('factorystyle'), 'Format', 'eps'); 
cd(fp.matlab)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Panel D: Elasticity of Substitution in CES (Skills vs Overall Parent-Peer Investments);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;

param_con_pertub = param_con;
for j = 1:1:length(grid_perturb)

param_con_pertub(8) = param_con(8)*grid_perturb(j);
               
sim = sim_data_function(param_con_pertub,fp) ;
simul_data = sim.sim_data ; 
sim_data_network = sim.sim_data_network;
sim_moments = mom_function(simul_data,sim_data_network,fp);    
moment_perturb(j,4) = sim_moments(18,1);
moment_perturb_keep{4}(:,j)= sim_moments(:,1);
end

h4=figure;
plot(grid_perturb,moment_perturb(:,4),'--bo','LineWidth',3.5,...
                       'MarkerEdgeColor','b',...
                       'MarkerFaceColor','b',...
                       'MarkerSize',7.5)
hold on
%plot(grid_perturb,repmat(data_moments(18,1),[length(grid_perturb),1]),'-r','LineWidth',1.5)
%legend('Regression Coefficient (Model)', 'Regression Coefficient (Data)', 'Location', 'northwest') 
%legend('Regression Coefficient', 'Location', 'northwest') 
xlabel('Elast. Substitution Skills vs. Parents/Peers (\alpha_{4,0}, relative to baseline estimates)');
ylabel('Effect of Skills on Parental Investments (Regression Coeff)');
hold off
xticks(grid_perturb)
cd(fp.paper)    
hgexport(h4, 'Perturbation4.png',hgexport('factorystyle'), 'Format', 'png');
hgexport(h4, 'Perturbation4.eps',hgexport('factorystyle'), 'Format', 'eps'); 
cd(fp.matlab)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Panel E: Impact of Parenting Style on Technology TFP;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;


param_con_pertub = param_con;
for j = 1:1:length(grid_perturb)

param_con_pertub(4) = param_con(4)*grid_perturb(j);
               
sim = sim_data_function(param_con_pertub,fp) ;
simul_data = sim.sim_data ; 
sim_data_network = sim.sim_data_network;
sim_moments = mom_function(simul_data,sim_data_network,fp);    
moment_perturb(j,5) = sim_moments(1,1);
moment_perturb_keep{5}(:,j)= sim_moments(:,1);

end


h5=figure;
plot(grid_perturb,moment_perturb(:,5),'--bo','LineWidth',3.5,...
                       'MarkerEdgeColor','b',...
                       'MarkerFaceColor','b',...
                       'MarkerSize',7.5)
hold on
%plot(grid_perturb,repmat(data_moments(18,1),[length(grid_perturb),1]),'-r','LineWidth',1.5)
%legend('Regression Coefficient (Model)', 'Regression Coefficient (Data)', 'Location', 'northwest') 
%legend('Regression Coefficient', 'Location', 'northwest') 
xlabel('Parenting Style Impact on Child Development (\psi_2, relative to baseline estimates)');
ylabel('Fraction Authoritharian Parents');
hold off
xticks(grid_perturb)
cd(fp.paper)    
hgexport(h5, 'Perturbation5.png',hgexport('factorystyle'), 'Format', 'png');
hgexport(h5, 'Perturbation5.eps',hgexport('factorystyle'), 'Format', 'eps'); 
cd(fp.matlab)

end